package com.jj.mapper;

import com.jj.pojo.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmpMapper {
    @Select("select * from emp where id = #{id}")
    List<Emp> select(Integer id);
    @Delete("delete from emp where id = #{ids}")
    void delete(Integer ids);
    @Insert("insert into emp(username,password,name,gender,image,job,entrydate,dept_id,salary,create_time,update_time) " +
        "values(#{username},#{password},#{name}, #{gender},#{image},#{job},#{entrydate},#{deptId},#{salary},#{createTime},#{updateTime})")
    void insert(Emp emp);

    void update(Emp emp);
@Select("select * from emp")
List<Emp> select1(Emp emp);
@Select("select * from emp where username = #{username} and password = #{password}")
    Emp login(Emp emp);
}
